<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

    <title>登录</title>
    
    <style>
        body {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            margin: 0;
            background-image: url("https://lining-web-tlias.oss-cn-beijing.aliyuncs.com/%E4%BB%93%E5%BA%93%E8%83%8C%E6%99%AF.jpg");
            background-size: cover;
            font-family: Arial, sans-serif;
        }
        

        .signinpanel {
            width: 400px;
            padding: 30px;
            background-color: rgba(255, 255, 255, 0.5); /* 使用 rgba 设置背景颜色的透明度 */
            border-radius: 5px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        }

        .signinpanel p.m-t-md {
            text-align: center;
            font-weight: bold;
            font-size: 20px;
        }
        
        .signinpanel h4 {
            margin-bottom: 0;
        }
        
        .signinpanel input[type="text"],
        .signinpanel input[type="password"] {
            width: 100%;
            padding: 10px;
            margin-bottom: 20px;
            border: 1px solid #ccc;
            border-radius: 4px;
            box-sizing: border-box;
        }
        
        .signinpanel button {
            width: 100%;
            padding: 10px;
            background-color: #005FAB;
            color: #fff;
            font-size: 16px;
            font-weight: bold;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }
        
        .signinpanel button:hover {
            background-color: #0056b3;
        }
        
        .signup-footer {
            text-align: center;
        }
    </style>

</head>

<body class="signin">
    <div class="signinpanel">
        <div class="row">
            <div class="col-sm-12">
                <form method="post">
                    <p class="m-t-md">仓库管理系统</p>
                    <input type="text" name="name" class="form-control uname" placeholder="用户名" style="background-color: rgba(255, 255, 255, 0.7);" />
                    <input type="password" name="pass" class="form-control pword m-b" placeholder="密码" style="background-color: rgba(255, 255, 255, 0.7);" />

                    <button class="btn btn-success btn-block" type="button">登录</button>
                </form>
            </div>
        </div>
        <div class="signup-footer">
            <div class="pull-left">
                
            </div>
        </div>
    </div>
    
    <script type="text/javascript" src="/layui/layui.js"></script>
    <script type="text/javascript" src="/js/funs.js"></script>
    <script type="text/javascript">
       var $;
       var layer;
       layui.use(["jquery","layer"],function(){
            $=layui.jquery;
            layer=layui.layer;

            $("button").click(function(){
                var name=$("[name=name]").val();
                var pass=$("[name=pass]").val();
                ajax_post("/User/login",{"name":name,"pass":pass},function(json){
                    if(json.status>0){
                        location.href="/index.html";
                    }else{
                        openAlert(json.msg);
                    }
                });
            });
       });
    </script>
</body>

</html>
